<?php
session_start();
include_once("../../../untils/conn.php");
mysqli_query($con, "set names utf8");

$type = "web_config";
$sql = "SELECT * FROM foundation WHERE type='$type'";
$result = mysqli_query($con, $sql);

// 构建 JSON 数据并输出给前端
$data = array();
if(mysqli_num_rows($result) > 0) {
    while($row = mysqli_fetch_assoc($result)) {
        $site_name = $row['site_name'];
        $site_seo = $row['site_seo'];
        $site_key = $row['site_key'];
        $site_ms = $row['site_ms'];
        $light_logo = $row['light_logo'];
        $dark_logo = $row['dark_logo'];
        $reuser = $row['reuser'];
        $loginuser = $row['loginuser'];
        $site_icp = $row['site_icp'];

        // 将数据添加到数据数组中
        $data["site_name"] = $site_name;
        $data["site_seo"] = $site_seo;
        $data["site_key"] = $site_key;
        $data["site_ms"] = $site_ms;
        $data["reuser"] = $reuser;
        $data["loginuser"] = $loginuser;
        $data["site_icp"] = $site_icp;
    }
}

// 将数据数组转换为 JSON 格式并输出
echo json_encode($data);
?>
